package com.lottery.game.core.modules.mapper;

import com.lottery.game.core.modules.entity.game.GameRoom;
import com.lottery.game.core.modules.entity.user.GameUser;
import com.lottery.game.core.modules.entity.user.TokenEntity;

import org.apache.ibatis.annotations.Param;

import java.util.Map;

/**
 * 游戏用户DAO接口
 * @author chenye
 * @version 2018-0414
 */
public interface UserLoginDao {
	Integer queryUserCount(@Param("username") String username, @Param("phone") String phone);
	void insertUser(GameUser gameuser);
	public Map<String, Object>  pwdLogin(Map<String, Object> m);
	//通过用户名密码获取用户
	GameUser getGameUserBynamepwd(@Param("username") String username,
          @Param("password") String password);
	//通过用户名获取用户
	GameUser getGameUserByUserName(@Param("username") String username);
	/*
	 * 通过用户名得到盐
	 */
	String getSaltByUsername(String username);
	//获取用户列表数据
	public Map<String, Object>  getGameUserListdata(Map<String, Object> map);

	//获取用户列表级别信息
	public Map<String, Object>  getGameUserLevel(Map<String, Object> map);
	//获取用户数量
	public Integer  getGameUserListdataCount(Map<String, Object> map);


	void insertAccessToken(TokenEntity entity);

	Integer queryAccessTokenByClientId(@Param("clientId") String clientId);

	Integer queryAccessTokenByToken(@Param("accessToken") String accessToken);

	void updateAccessToken(TokenEntity entity);

	GameUser getUserByPhone(@Param("phone") String phone);

	//额外接口获取房间
	GameRoom queryRoomCount(String roomNo);
}
